﻿using System.ComponentModel;
using System.ComponentModel.DataAnnotations.Schema;
using PmSoft.Core.Domain.Auth;
using PmSoft.Core.Domain.Entities;
using PmSoft.Core.Domain.Entities.Caching;
using PmSoft.Data.Abstractions.Attributes;

namespace Cmsp3.Common.Domains
{
	/// <summary>
	/// 角色菜单关系表
	///</summary>
	[Table("sys_role_menu")]
	[CacheSetting(true, PropertyNamesOfArea = "RoleId")]
	[Description("角色菜单关系表")]
	public class SysRoleMenu : Entity<int>
	{
		/// <summary>
		/// 主键
		/// </summary>
		[PrimaryKey("id")]
		public override int Id { get; set; }
		/// <summary>
		/// 角色ID 
		///</summary>
		[Column("role_id")]
		public int RoleId { get; set; }
		/// <summary>
		/// 菜单ID 
		///</summary>
		[Column("menu_id")]
		public int MenuId { get; set; }
		/// <summary>
		/// 访问层级：self（本级）、child（下级）、parent（上级）、self_with_child（本级+下级） 
		///</summary>
		[Column("access_level")]
		public byte? AccessLevel { get; set; }
 
	}
}
